<template>
  <nav>
    <router-link tag="span" to="/city">杭州</router-link>
    <ul>
      <router-link
        :to="{ path: item.url }"
        v-for="item in list"
        :key="item.title"
        tag="li"
      >
        {{ item.title }}
      </router-link>
    </ul>
    <span class="iconfont icon-sousuo" @click="goTosea"></span>
  </nav>
</template>

<script>
export default {
  data() {
    return {
      // list: ["热映", "影院", "待映", "经典电影"],
      list: [
        {
          title: "热映",
          url: "/home/movies/hot",
        },
        {
          title: "影院",
          url: "/home/movies/cinema",
        },
        {
          title: "待映",
          url: "/home/movies/wait",
        },
        {
          title: "经典电影",
          url: "/home/movies/classic",
        },
      ],
      // red: "影院",
    };
  },
  methods: {
    goTosea() {
      this.$router.push("/search");
    },
  },
};
</script>

<style lang="less" scoped>
@import "../../assets/css/var.less";
nav {
  width: 100%;
  height: 45px;
  border-bottom: 1px solid @border-color;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;

  span:first-child {
    width: 80px;
    font-size: 14px;
    color: #777;
    .center();
  }

  ul {
    width: 240px;
    height: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 14px;

    li {
      height: 100%;
      line-height: 45px;
    }

    .router-link-active {
      position: relative;
      &::after {
        content: "";
        position: absolute;
        width: 12px;
        height: 3px;
        background: red;
        left: 50%;
        transform: translateX(-50%);
        bottom: 6px;
        border-radius: 1.5px;
      }
    }
  }

  .icon-sousuo {
    color: @theme-color;
    width: 40px;
    .center();
  }
}
</style>
